package com.bwie;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import reactor.core.publisher.Mono;

/**
 * @Auther:${涛}
 * @Date:2024/9/2 09:20
 * @Description: GatewayAppcation
 * @Version 1.0.0
 */
@SpringBootApplication
public class GatewayAppcation {
    public static void main(String[] args) {
        SpringApplication.run(GatewayAppcation.class);
        System.out.println("Gateway启动成功");
    }

    @Bean
    public KeyResolver ipKeyResolver() {
        return exchange -> Mono.just(exchange.getRequest().getRemoteAddress().getHostName());
    }
}


